package com.welinkdata;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.File;
import java.io.IOException;

/**
 * Created by Administrator on 2016/8/25.
 */
public class Demo {

    public static void main(String[] args) throws IOException {

        File file = new File("D:\\hplus4.1.0\\table_basic.html");
        Document document = Jsoup.parse(file,"utf-8");
//        System.out.println(document);
        Elements elements = document.select("div[class=ibox-content]");
//        System.out.println(elements);
        Element element = elements.get(0);
//        System.out.println(element.html());
        Elements trs = element.getElementsByTag("tr");
//        for(Element tr : trs){
////            System.out.println(tr.text());
//
//        }
        for(int i =1; i< trs.size(); i++){
            Element tr =  trs.get(i);
            Elements tds =  tr.getElementsByTag("td");
            for(Element td : tds){
                System.out.print(td.text());
            }
            System.out.println();

        }

    }
}
